package rattlesnake.callback.modle.dto;

import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.http.HttpObject;
import io.netty.handler.codec.http.HttpRequest;

/**
 * @Package: rattlesnake.callback.modle
 * @Description: 封装用于重复请求的信息
 * @author: liuxin
 * @date: 17/4/14 下午3:23
 */
public class HttpRequestWrapper {
    private ChannelHandlerContext ctx;
    private HttpRequest request;
    private HttpObject msg;
    private String url;
    private String success;
    private String error;
    private Integer errorNum;

    public HttpRequestWrapper(ChannelHandlerContext ctx, HttpRequest request, HttpObject msg, String url, String success, String error) {
        this.ctx = ctx;
        this.request = request;
        this.msg = msg;
        this.url = url;
        this.success = success;
        this.error = error;
        errorNum=0;
    }

    public ChannelHandlerContext getCtx() {
        return ctx;
    }

    public void setCtx(ChannelHandlerContext ctx) {
        this.ctx = ctx;
    }

    public HttpRequest getRequest() {
        return request;
    }

    public void setRequest(HttpRequest request) {
        this.request = request;
    }

    public HttpObject getMsg() {
        return msg;
    }

    public void setMsg(HttpObject msg) {
        this.msg = msg;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getSuccess() {
        return success;
    }

    public void setSuccess(String success) {
        this.success = success;
    }

    public String getError() {
        return error;
    }

    public void setError(String error) {
        this.error = error;
    }

    public Integer getErrorNum() {
        this.errorNum=this.errorNum+1;
        return errorNum;
    }

    public void setErrorNum(Integer errorNum) {
        this.errorNum = errorNum;
    }
}
